<html>
<head>
<link rel=stylesheet type="text/css" href="/media/malfind.css" title="malfind">
<script language="JavaScript" src="/media/malfind.js"></script>
<link rel="icon" href="/media/favicon.ico" type="image/x-icon">
<title>MalFind Results for {%if url%}{{url|escape}}{%else%}&quot;&quot;{%endif%}</title>
</head>
<body>

<div align="left" style="position:absolute;"><a href="/" style="color:#44f"><img src="/favicon.ico" border="0" align="top">Home</a></div>
<div align="right" style="margin-bottom:2em;">
{%if userdata.user%}<b>{{userdata.user|escape}}</b>	 |{%endif%}
<a href="http://code.google.com/p/malfind2/issues/list" style="color:#44f">Report bug</a> |
{%if userdata.admin%}<a href="/stats" style="color:#44f">Admin</a> |{%endif%}
{%if userdata.user%}<a href="{{userdata.logout|escape}}" style="color:#44f">Sign out</a>{%else%}
<a href="{{userdata.login|escape}}" style="color:#44f">Sign In</a>{%endif%}
</div>
	
<div class=top>
<form action='/check'>
<table><tr><td><a class="mf" href="/">MalFind</a></td>
<td><input name=url value="{%if url%}{{url|escape}}{%endif%}" size=40></td>
<td><input type=submit value="Check" name="check"></td>
</tr></table>
</form>
</a>

</div>

{% if url %}
  <h3>Overview for {{url|escape}}</h3>
  <ul>
    {% if blacklisted %}
      <li><span class=blacklisted>This page matches Google's malware blacklist. <a href="http://www.google.com/safebrowsing/diagnostic?site={{url|urlencode}}">Learn More</a></span></li>
    {% endif %}
    {% if findings %}
      {% for group in findings %}
        <li>{{group.items|length}} {{group.name}}{{group.items|length|pluralize}}</li>
      {% endfor %}
    {% else %}
      {% if errors %}
        <li> Some errors occurred during processing this page. </li>
      {% else %} 
        <li>No suspicious content found.</li>
      {% endif %}
    {% endif %}
  </ul>
{% endif %}

<!-- Findings -->
{% for group in findings %}
  <h3 class="clickme" onclick="return toggle('{{group.name}}');">
	<table><tr><td>
  <img class="expand" id="img-{{group.name}}" src='media/minus.gif' width=14 height=14>
  </td><th>{{group.name|capfirst}}{{2|pluralize}}</th></tr></table>
  </h3>
  <div id={{group.name}}>
  <ul>
  {% for item in group.items %}
    <li class=item>
    {% if item.src %}
      <div>External {{item.name}} from 
      <a href="/check?url={{item.src|urlencode}}"><span class=url>{{item.src|escape}}</span></a>
      </div>
      {% if item.blacklisted %}
        <div class=blacklisted>This {{item.name}}'s url matches Google's 
        Malware Blacklist. <a href="http://www.google.com/safebrowsing/diagnostic?site={{item.src|urlencode}}">Learn More</a></div>
      {% endif %}
    {% else %}
      <div>Inline {{group.name}}</div>
    {% endif %}
    <pre width=80>{{item.contents|escape}}</pre>
    </li>
  {% endfor %}
  </ul>
  </div>
{% endfor %}


{% if errors %}
<h4 class="clickme" onclick="return toggle('errors');">
  <table><tr><td>
  <img class="expand" id="img-{{group.name}}" src='media/minus.gif' width=14 height=14> 
  </td><th>Some errors occurred during processing this url:</th></tr></table>
</h4>
<div id='errors' class=code>
<ul>
{% for error in errors %}
  <li>{{error|escape}}</li>
{% endfor %}
</ul>
</div>
{% endif %}


{% if source %}
  <h4 class="clickme" onclick="return toggle('sourcecode');">
	<table><tr><td>
	<img class="expand" id="img-{{group.name}}" src='media/plus.gif' width=14 height=14> 
  </td><th>Source of {{url|escape}}</th></tr></table>
  </h4>
  <div id='sourcecode' style="display:none">
   <pre width=80>{{source|escape}}</pre>
  </div>	
{% endif %}


</body>
</html>
